package homework.billing.meter;

import homework.billing.meter.simple.LadderMeter;

public class LadderTaxiMeter extends BaseItemsMeter {

    private LadderMeter mileageMeter;

    private float startingPrice;
    private float startingMileage;

    public LadderTaxiMeter(float sp, float sm) {
        mileageMeter = new LadderMeter();

        startingPrice = sp;
        startingMileage = sm;
    }

    @Override
    public double mileageCost(float mileage) {
        if(mileage <= 0) return 0;

        float result = startingPrice;
        if(mileage > startingMileage)
            result += mileageMeter.cost(mileage);
        return result;
    }

    @Override
    public double waitingMinuteCost(float waiting) {
        return 0;
    }

    @Override
    public double totalMinuteCost(float totalMinute) {
        return 0;
    }

    public void addLadder(float l, float v) {
        mileageMeter.addLadder(l, v);
    }
}
